<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <link href="/styles/base.css" rel="stylesheet" type="text/css">
    <link href="/js/datepicker/datepicker.css" rel="stylesheet">
    <link href="/styles/wendaDetail.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/js/jquery/jquery.js"></script>
    <script type="text/javascript" src="/js/plugins/jquery-form/jquery.form.js"></script>
    <link href="/js/plugins/jqPaginator/jqPagination.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/js/plugins/jqPaginator/jq-paginator.min.js"></script>
    <script type="text/javascript" src="/js/system/strategyDetail.js"></script>
    <script type="text/javascript" src="/js/system/common.js"></script>
    <script type="text/javascript" src="/js/plugins/shareSDK/ShareSDK.js"></script>
</head>
<style>
    .wgt-exp-share .w-txt {
        font-family: "Microsoft Yahei", arial, 宋体, sans-serif;
        font-size: 14px;
        color: rgb(255, 255, 255);
        display: none;
        line-height: 18px;
        padding-top: 6px;
    }
</style>
<script>
    $(function () {
        console.log(1);
        $('#submitAnswer').click(function () {
            var $id = $(this).data("id");
            console.log(2);
            console.log($id);
            $('#answerForm').submit();
        })

        $("#attention_btn").click(function(){
            var state = $(this).data("state");
            console.log(3);
            console.log(state);
            $.post("/question/attention",{state:state,questionId:${question.id}},function(data){
                console.log(data);
                if(data.success){
                    if(state==1){
                        popup("取关成功");
                        $("#attention_btn").data("state",0)
                        $("#attention_bb").html("关注")
                        console.log("取关成功");
                    }else{
                        popup("关注成功");
                        $("#attention_btn").data("state",1)
                        $("#attention_bb").html("取关")
                        console.log("关注成功");
                    }
                }else{
                    console.log(data.msg);
                }
            })
        })
        $(".thumbsup_btn").click(function(){
            console.log(5);
            $(this)
            var answerId = $(this).data("id");
            $.get("/question/answerThumbup", {answerId:answerId}, function (data) {
                if(data.success){
                    popup("顶成功啦"); //
                    /*window.location.href*/
                    location.reload()
                }else{
                    if(data.code == 102){
                        popup(data.msg);
                    }else{
                        popup("今天你已经定过了"); //
                    }
                }
            });
        })
    })
</script>

<body style="position: relative;">
 <#assign currentNav="question">
    <#include "../common/navbar.ftl">
<div class="wrapper">
    <div class="detail-wrap clearfix">
        <div class="col-main">
            <div class="q-detail">
                <div class="q-content">
                    <div class="q-title">
                        <a href="/wenda/area-10065.html" target="_blank"
                           class="location"><i></i>${(question.dest.name)!}</a>
                        <h1>
                            <a href="/wenda/detail-18458675.html">${(question.title)!}</a>
                        </h1>
                    </div>
                ${(question.content)!}
                    <div class="q-info1 clearfix">
                        <div class="q-tags fl">
                            <a class="a-tag" href="/wenda/area-10065.html" target="_blank">${(question.dest.name)!}</a>
                        </div>
                        <div class="pub-bar fr">
                            <a href="/wenda/u/43303516/answer.html" class="photo" target="_blank"> <img
                                    src="${(question.author.headImgUrl)!}"
                                    width="16" height="16"></a>
                            <a class="name" href="/wenda/u/43303516/answer.html"
                               target="_blank">${(question.author.nickname)!}</a>
                            <span class="time"><span>${(question.createTime?string("yyyy-MM-dd HH:mm:ss"))!}</span></span>
                        </div>
                    </div>
                </div>
                <div class="q-operate clearfix">
                    <div class="fl">
                        <!-- 问题分享 -->
                        <div class="q-share cate-share">
                            <a class="_js_showShare"><i class="q-share-icon"></i>分享</a>
                            <div class="share-pop _j_share_pop hide clearfix" data-title="为什么说在北京通勤等于取经？上下班到底有多苦？"
                                 data-qid="18458675">
                                <a title="分享到新浪微博" class="sina _j_do_share" data-site="wb"></a>
                                <a title="分享到QQ空间" class="zone _j_do_share" data-site="qz"></a>
                                <a title="分享到微信" class="weixin _j_do_share_wx" data-site="wx"></a>
                            </div>
                        </div>
                        <!-- 邀请回答 -->
                        <div class="seek-help _j_tip_box">
                            <a class="_j_seek_help_new">邀请蜂蜂回答</a>
                        </div>
                        <!-- 举报 -->
                        <div class="admin_hide tip-off">
                            <a data-japp="report" data-refer="http://www.mafengwo.cn/wenda/detail-18458675.html"
                               data-refer-uid="43303516" data-app="qa.question" data-busi-id="qid:18458675">举报</a>
                        </div>
                    </div>
                    <div class="fr">
                        <span class="atten-num">${(question.viewnum)!0}浏览</span>
                        <span class="atten-num"><span class="_j_same_num">${(question.attentionnum)!0}</span>人关注</span>

                        <a data-state="${attention}" class="btn-atten _j_same_question " id="attention_btn" rel="nofollow"><span id="attention_bb">
                            <#if attention ==1>
                                取关
                                <#else >
                                关注
                            </#if>
                        </span></a>
                    <#--<a class="btn-answer _j_btn_goanswer" rel="nofollow">回答</a>-->
                    </div>
                </div>
            </div>
            <hr/>
            <div class="answer-wrap">
          <#list answers as answer>

          <div class="bd _j_pager_box">
              <ul class="answer-list answer_detail">
                  <div>
                      <li>
                          <div class="answer-side _js_answerAva">
                              <!-- <a class="btn-ding _js_zan "><i></i><span data-real_num="3">3</span></a> -->
                          </div>
                          <div class="answer-content _js_answer_content">
                              <div class="answer-info clearfix">
                                  <div class="user-bar fl">
                                      <a class="_j_filter_click avatar" href="javascript:;" target="_blank"><img
                                              src="${(answer.author.headImgUrl)!}"
                                              width="48" height="48" class="photo"></a>
                                      <a class="name" href="javascript:;"
                                         target="_blank">${(answer.author.nickname)!}</a>
                                      <a class="level" href="javascript:;" target="_blank"
                                         rel="nofollow">${(answer.author.level)!}</a>
                                      <a class="identity i-guide" href="javascript:;" target="_blank">指路人</a>
                                  </div>
                                  <ul class="answer-medal fr">
                                      <li class="gold">
                                          <div class="btn"><i></i>
                                              <a href="javascript:;" data-id="${(answer.id)!}" class="thumbsup_btn" target="_blank">${(answer.thumbsupnum)!0}  顶 !</a></div>
                                      </li>
                                  </ul>
                              </div>
                              <!-- 回答内容 -->
                              <div class="_j_short_answer_item hide" style="display: block;">
                                  ${(answer.content)!}
                              </div>
                          </div>
                      </li>
                  </div>
              </ul>
          </div>
<br>
<br>
<br>
          </#list>

            <#--<div class="bd _j_pager_box">
                <div class="aa-hd">
                    <a href="/wenda/u/43303516/answer.html" class="photo" target="_blank"> <img
                            src="${(userInfo.headImgUrl)!}"
                            width="16" height="16"></a>
                    <a class="aa-name">${(userInfo.nickname)!}</a>
                </div>
                <div class="editor-outer _j_editorOuter _js_editorWrap _js_forFixTitle">
                    <textarea></textarea>
                </div>
                <div class="aa-ft">
                    <input class="btn-comment _j_submit_answer_btn" type="button" value="提交回答"/>
                </div>
            </div>-->
            </div>
        </div>
        <div class="col-side"></div>
    </div>
</div>

<div>
    <div id="wgt-exp-share" class="wgt-exp-share"
         style="position: fixed; display: block; bottom: 44px; right: 356.5px;">
        <div id="weixin-wrap-wgt" class="wx-wrp-wgt">
            <div class="wx-arrow"></div>
            <div id="qrcode-wrp" class="qrcode-wrp"
                 title="https://jingyan.baidu.com/article/d169e186f1fcf1036611d8cb.html">
                <canvas width="104" height="104" style="display: none;"></canvas>
                <div class="aa-ft">
                    <form action="/question/inputAnswer" id="answerForm" method="post">
                        <input type="hidden" name="questionId" value="${(question.id)!}">
                    <input id="submitAnswer" data-id="${(question.id)!}" class="btn-comment _j_submit_answer_btn" type="button" value="回答"/>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
</html>